package org.bee.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 全局消息通知消息队列
 */
@Configuration
public class RabbitConfig {
    @Bean
    public Queue noticeQueue(){
        return new Queue("noticeQueue");
    }
    @Bean
    DirectExchange noticeExchange() {
        return new DirectExchange("noticeExchange");
    }
    @Bean
    Binding smsBinding() {
        return BindingBuilder.bind(noticeQueue()).to(noticeExchange()).with("notice");
    }
}
